function res = gammapln(nu, N)

Arg = [nu-N+1:nu];
res = (N*(N-1)/4)*log(pi) + sum(gammaln(Arg/2));
